<template>
  <div>
    <div>
      <div class="EditProfile-my">
        <div v-if="nextBuData==1 || isshow">
          <p class="bg"></p>
          <div class="EditProfile-my_die_one">
            <div>基本信息</div>
            <div>
              <span>机构名称</span>
              <input
                type="text"
                placeholder="请填写您的机构名称"
                v-model.lazy="datas.auth_company_name"
                placeholder-class="placeholder"
              />
            </div>
            <div class="EditProfile-my_die_times">
              <span>设立时间</span>
              <picker
                mode="date"
                :value="timeData"
                start="1949-01-01"
                :end="nowTime"
                @change="bindDateChange"
              >
                <div class="pickerss">
                  <input
                    type="text"
                    disabled="true"
                    v-model.lazy="datas.auth_time"
                    class="picker_input"
                    placeholder-class="placeholder"
                  />
                  <img src="http://www.zhaoshengku.net/wx-times.png" alt class="picker_img" />
                </div>
              </picker>
            </div>
            <div>
              <span>统一社会信用代码</span>
              <input
                type="text"
                placeholder="请填写您机构的信用代码"
                v-model.lazy="datas.auth_license_code"
                placeholder-class="placeholder"
              />
            </div>
            <div>
              <span>注册地址</span>
              <input
                type="text"
                placeholder="请填写您机构营业执照上的注册地址"
                v-model.lazy="datas.auth_license_address	"
                placeholder-class="placeholder"
              />
            </div>
            <div>
              <span>实际经营地址</span>
              <div class="section">
                <div>
                  <picker @change="bindPickerChangeone" :range="shengarr" mode="selector">
                    <div class="picker">{{datas.info_province}}</div>
                  </picker>
                </div>
                <div>
                  <picker @change="bindPickerChangetwo" :range="shiarr" mode="selector">
                    <div class="picker">{{datas.info_city}}</div>
                  </picker>
                </div>
                <div>
                  <picker @change="bindPickerChangestr" :range="xianarr" mode="selector">
                    <div class="picker">{{datas.info_county}}</div>
                  </picker>
                </div>
              </div>
            </div>
            <div>
              <span>详细地址</span>
              <input
                type="text"
                name
                id
                placeholder="请填写实际经营详细地址"
                v-model.lazy="datas.auth_license_true_address"
              />
            </div>
            <div>
              <span>校长/负责人姓名</span>
              <input
                type="text"
                placeholder="请填写您机构法定代表人姓名"
                v-model.lazy="datas.auth_principal"
                placeholder-class="placeholder"
              />
            </div>
            <div>
              <span>负责人手机号</span>
              <input
                type="text"
                placeholder="请填写负责人手机号"
                v-model.lazy="datas.auth_mobile"
                placeholder-class="placeholder"
              />
            </div>
            <div>
              <span>办学资质类型</span>
              <input
                type="text"
                placeholder="请填写办学资质类型"
                v-model.lazy="datas.auth_credentials_type"
                placeholder-class="placeholder"
              />
            </div>
            <div>
              <span>办学资质证号</span>
              <input
                type="text"
                placeholder="请填写办学资质证号"
                v-model.lazy="datas.auth_credentials_code"
                placeholder-class="placeholder"
              />
            </div>
            <div>
              <span>发证机关</span>
              <input
                type="text"
                placeholder="请填写发证机关名称"
                v-model.lazy="datas.auth_office"
                placeholder-class="placeholder"
              />
            </div>
            <div>
              <span>法人登记部门</span>
              <input
                type="text"
                placeholder=" "
                v-model.lazy="datas.auth_office_branch"
                placeholder-class="placeholder"
              />
            </div>
            <div class="div_nth_eit">
              <span>场地性质</span>
              <input
                type="text"
                placeholder=" "
                v-model.lazy="datas.auth_address_type"
                placeholder-class="placeholder"
              />
              <img src="http://www.zhaoshengku.net/wx-xz.png" alt />
              <span>教职工数</span>
              <input
                type="text"
                placeholder=" "
                v-model.lazy="datas.auth_staff_number"
                placeholder-class="placeholder"
              />
              <div>人</div>
            </div>
          </div>
          <div class="next_button" @click="nextRequest" v-if="!isshow">下一步</div>
        </div>
        <div v-if="nextBuData==2 || isshow">
          <p class="bg"></p>
          <div class="EditProfile-my_die_one">
            <div>办学信息</div>
            <div>
              <span>培训类别</span>
              <input
                type="text"
                placeholder=" "
                v-model.lazy="datas.auth_train_type"
                placeholder-class="placeholder"
              />
              <img src="http://www.zhaoshengku.net/wx-xz.png" alt style="width:12rpx;height:22rpx" />
            </div>
            <div>
              <span>培训范围</span>
              <input
                type="text"
                placeholder="请填写您机构培训内容"
                v-model.lazy="datas.auth_train_content"
                placeholder-class="placeholder"
              />
            </div>
            <div>
              <span>招生范围</span>
              <input
                type="text"
                placeholder="范围"
                v-model.lazy="datas.auth_students_type"
                placeholder-class="placeholder"
              />
              <img src="http://www.zhaoshengku.net/wx-xz.png" alt style="width:12rpx;height:22rpx" />
            </div>
            <div>
              <span>招生对象</span>
              <input
                type="text"
                placeholder=" "
                v-model.lazy="datas.auth_students_entity"
                placeholder-class="placeholder"
              />
              <img src="http://www.zhaoshengku.net/wx-xz.png" alt style="width:12rpx;height:22rpx" />
            </div>
            <div class="last_div_bottom">
              <span>培训形式</span>
              <input
                type="text"
                placeholder=" "
                v-model.lazy="datas.auth_train"
                placeholder-class="placeholder"
              />
              <img src="http://www.zhaoshengku.net/wx-xz.png" alt style="width:12rpx;height:22rpx" />
            </div>
          </div>
          <div class="next_button" @click="nextRequestTwo" v-if="!isshow">下一步</div>
        </div>
        <div v-if="nextBuData==3 || isshow">
          <p class="bg"></p>
          <div class="EditProfile-my-two">
            <div>身份证认证</div>
            <ul>
              <li>
                <div>法人姓名</div>
                <div>
                  <input
                    type="text"
                    name
                    id
                    placeholder="请填写真实姓名"
                    v-model.lazy="datas.auth_name"
                    placeholder-class="placeholder"
                  />
                </div>
              </li>
              <li>
                <div>身份证号</div>
                <div>
                  <input
                    type="text"
                    name
                    id
                    placeholder="请填写本人身份证号码"
                    v-model.lazy="datas.auth_cardid"
                    placeholder-class="placeholder"
                  />
                </div>
              </li>
            </ul>
            <div class="EditProfile-my-two-sfz">
              <p>上传本人身份证</p>
              <ul>
                <li>
                  <div
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfive.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                  >
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                  </div>
                  <p
                    v-show="!isshow"
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfivekaobei.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                    @click="tabHeaderSrc(0)"
                  >上传正面</p>
                  <img :src="datas.auth_card_img_a" alt />
                </li>
                <li>
                  <div
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfive.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                  >
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                  </div>
                  <p
                    v-show="!isshow"
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfivekaobei.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                    @click="tabHeaderSrc(1)"
                  >上传反面</p>
                  <img :src="datas.auth_card_img_b" alt />
                </li>
              </ul>
            </div>
            <div class="EditProfile-my-two-sfz EditProfile-my-two-sfzs">
              <p>示例</p>
              <ul>
                <li>
                  <div
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfive.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                  >
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                  </div>
                  <img src="http://www.zhaoshengku.net/shiliangzhinengduixkaob.png" alt />
                </li>
                <li>
                  <div
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfive.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                  >
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                  </div>
                  <img src="http://www.zhaoshengku.net/wx-zhienengshiliangduixiangkaobei.png" alt />
                </li>
              </ul>
              <div>
                <p>1、请保证图片焦点清晰，不可太小或模糊不清；</p>
                <p>2、不可有反光影响文字显示；</p>
                <p>3、请让四个边角完整显示 不要用手遮挡身份证；</p>
                <p>4、请不要自行加水印；</p>
                <p>5、请不要使用扫描件或者、复印件。</p>
              </div>
            </div>
          </div>
          <p class="bg"></p>
          <div class="EditProfile-my-thr">
            <p>营业执照认证</p>
            <div class="EditProfile-my-two-sfz EditProfile-my-two-sfza">
              <ul>
                <li>
                  <div
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfive.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                  >
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                  </div>
                  <p
                    v-show="!isshow"
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfivekaobei.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                    @click="tabHeaderSrc(2)"
                  >上传资料</p>
                  <img :src="datas.auth_license" alt />
                </li>
              </ul>
            </div>
            <div class="EditProfile-my-two-sfz_shili">
              <div>示例</div>
              <div>
                <p>
                  <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                  <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                </p>
                <p>
                  <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                  <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                </p>
                <p>
                  <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                  <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                </p>
                <p>
                  <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                  <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                </p>
                <img src="http://www.zhaoshengku.net/wx-yingyezhizhao.png" alt />
              </div>
              <div>请保证上传的照片边框完整，字迹清晰，亮度均匀</div>
            </div>
          </div>
          <p class="bg"></p>
          <div class="EditProfile-my-thr">
            <p>上传平台认证资料</p>
            <div class="EditProfile-my-two-sfz EditProfile-my-two-sfza">
              <ul>
                <li>
                  <div
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfive.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                  >
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsixkao.png" alt />
                    </p>
                    <p>
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                      <img src="http://www.zhaoshengku.net/wx-jvxingsix.png" alt />
                    </p>
                  </div>
                  <p
                    v-show="!isshow"
                    style="background: url('http://www.zhaoshengku.net/wx-jvxingfivekaobei.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                    @click="tabHeaderSrc(3)"
                  >上传资料</p>
                  <img :src="datas.auth_platform" alt />
                </li>
              </ul>
            </div>
            <p v-show="!isshow">*下载下方图片长按保存打印后填写正确信息并拍照上传</p>
            <ul>
              <li>
                <p>
                  <img
                    src="https://www.zhaoshengku.net/www.zhaoshengku.net.jpg "
                    alt
                    @click="downloadTask"
                    v-show="!isshow"
                  />
                </p>
              </li>
              <li
                v-show="!isshow"
                style="background: url('http://www.zhaoshengku.net/wx-yuaniaojvxingone.png') no-repeat; background-size: 100% 100%;background-position: center center; "
                @click="downloadTask()"
              >点击下载</li>
            </ul>
            <div></div>
          </div>
          <div>
            <p class="next_button" @click="tijiaoRequest" v-if="!isshow">确认提交</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import util from "../../utils/index";
import qiniuUploader from "../../../static/qiniuUploader";
export default {
  data() {
    return {
      arraySheng: [],
      shengarr: [],
      arrayShi: [],
      shiarr: [],
      arrayXianq: [],
      xianarr: [],

      indexSheng: -1,
      indexShi: -1,
      nowTime: "",
      nextBuData: 1,
      datas: {
        auth_time: "选择您机构的成立时间",
        auth_company_name: "",
        auth_name: "",
        auth_mobile: "",
        auth_license_code: "",
        auth_license_address: "",
        info_province_id: "",
        info_city_id: "",
        info_county_id: "",
        auth_license_true_address: "",
        auth_credentials_type: "",
        auth_credentials_code: "",
        auth_address_type: "",
        auth_office: "",
        auth_office_branch: "",
        auth_train_type: "",
        auth_train_content: "",
        auth_students_type: "",
        auth_students_entity: "",
        auth_train: "",
        auth_card_img_a: "",
        auth_card_img_b: "",
        auth_license: "",
        auth_name: "",
        auth_platform: "",
        auth_cardid: "",
        info_province: "选择省",
        info_city: "选择市",
        info_county: "选择区/县",
        auth_principal: ""
      },
      isshow: false,
      disabledShi: 0,
      disabledXian: 0,
      arrvalue: "",
      chongfushangcimg: false
    };
  },
  methods: {
    // 获取省
    bindPickerChangeone(e) {
      this.indexSheng = e.mp.detail.value;
      this.datas.info_province = this.shengarr[e.mp.detail.value];
      this.datas.info_province_id = this.arraySheng[this.indexSheng].city_id;
      wx.request({
        url: "https://api.zhaoshengku.net/api/data/getareas",
        method: "post",
        data: {
          city_pid: this.datas.info_province_id
        },
        success: res => {
          this.datas.info_city = "选择市";
          this.datas.info_county = "选择区/县";
          this.arrayShi = res.data.data;
          let arr = [];
          for (var i = 0; i < this.arrayShi.length; i++) {
            arr.push(this.arrayShi[i].city_name);
          }
          this.shiarr = arr;
          if (this.arrayShi.length > 0) {
            this.disabledShi = 1;
          }
        },
        fail: res => {
          if (res.errMsg) {
            wx.showToast({
              title: "请检查网络连接！",
              icon: "none",
              duration: 1500
            });
          }
        }
      });
    },
    //获取市
    bindPickerChangetwo(e) {
      if (this.datas.info_province == "选择省") {
        wx.showToast({
          title: "请先选择省！",
          icon: "none",
          duration: 1000
        });
        return;
      }
      this.indexShi = e.mp.detail.value;
      this.datas.info_city = this.shiarr[e.mp.detail.value];
      this.datas.info_city_id = this.arrayShi[this.indexShi].city_id;
      wx.request({
        url: "https://api.zhaoshengku.net/api/data/getareas",
        method: "post",
        data: {
          city_pid: this.datas.info_city_id
        },
        success: res => {
          this.datas.info_county = "选择区/县";
          this.arrayXianq = res.data.data;
          let arr = [];
          for (var i = 0; i < this.arrayXianq.length; i++) {
            arr.push(this.arrayXianq[i].city_name);
          }
          this.xianarr = arr;
          if (this.arrayXianq.length > 0) {
            this.disabledXian = 1;
          } else {
            this.disabledXian = 0;
          }
        },
        fail: res => {
          if (res.errMsg) {
            wx.showToast({
              title: "请检查网络连接！",
              icon: "none",
              duration: 1500
            });
          }
        }
      });
    },
    //获取区/县
    bindPickerChangestr(e) {
      if (this.datas.info_city == "选择市") {
        wx.showToast({
          title: "请先选择市！",
          icon: "none",
          duration: 1000
        });
        return;
      } else {
        this.arrvalue = this.xianarr[e.mp.detail.value];
        this.datas.info_county_id = this.arrayXianq[this.indexShi].city_id;
        this.xuanzshengshiquxian();
      }
    },
    // 设置时间
    bindDateChange(e) {
      this.datas.auth_time = e.mp.detail.value;
    },
    xuanzshengshiquxian() {
      if (this.arrvalue != this.datas.info_county) {
        this.datas.info_county = this.arrvalue;
      }
    },
    // 提交资料第一步
    nextRequest() {
      var arr = [];
      var headerCode;
      wx.showToast({
        title: "",
        icon: "loading",
        duration: 5000
      });
      wx.getStorage({
        key: "koken",
        success: res => {
          headerCode = "Bearer " + res.data;
          wx.request({
            url: "https://api.zhaoshengku.net/index/member/fastAuth",
            method: "POST",
            data: {
              auth_company_name: this.datas.auth_company_name,
              auth_principal: this.datas.auth_principal,
              auth_mobile: this.datas.auth_mobile,
              auth_time: this.datas.auth_time,
              auth_license_code: this.datas.auth_license_code,
              auth_license_address: this.datas.auth_license_address,
              info_province_id: this.datas.info_province_id,
              info_city_id: this.datas.info_city_id,
              info_county_id: this.datas.info_county_id,
              info_province: this.datas.info_province,
              info_city: this.datas.info_city,
              info_county: this.datas.info_county,
              auth_license_true_address: this.datas.auth_license_true_address,
              auth_credentials_type: this.datas.auth_credentials_type,
              auth_credentials_code: this.datas.auth_credentials_code,
              auth_address_type: this.datas.auth_address_type,
              auth_staff_number: this.datas.auth_staff_number,
              auth_office: this.datas.auth_office,
              auth_office_branch: this.datas.auth_office_branch
            },
            header: {
              Authorization: headerCode,
              "content-type": "application/x-www-form-urlencoded"
            },
            success: res => {
              if (res.data.code == 200) {
                wx.hideToast();
                this.nextBuData = 2;
              } else {
                wx.hideToast();
                wx.showToast({
                  title: res.data.msg,
                  icon: "none",
                  duration: 1000,
                  mask: true
                });
              }
            },
            fail: res => {
              if (res.errMsg) {
                wx.showToast({
                  title: "请检查网络连接！",
                  icon: "none",
                  duration: 1500
                });
              }
            }
          });
        }
      });
    },
    // 提交第二步
    nextRequestTwo() {
      var headerCode;
      wx.showToast({
        title: "",
        icon: "loading",
        duration: 5000
      });
      wx.getStorage({
        key: "koken",
        success: res => {
          headerCode = "Bearer " + res.data;
          wx.request({
            url: "https://api.zhaoshengku.net/index/member/twoAuth",
            method: "POST",
            data: {
              auth_train_type: this.datas.auth_train_type,
              auth_train_content: this.datas.auth_train_content,
              auth_students_type: this.datas.auth_students_type,
              auth_students_entity: this.datas.auth_students_entity,
              auth_train: this.datas.auth_train
            },
            header: {
              Authorization: headerCode,
              "content-type": "application/x-www-form-urlencoded"
            },
            success: res => {
              if (res.data.code == 200) {
                wx.hideToast();
                this.nextBuData = 3;
              } else {
                wx.hideToast();
                wx.showToast({
                  title: res.data.msg,
                  icon: "none",
                  duration: 1000,
                  mask: true
                });
              }
            },
            fail: res => {
              if (res.errMsg) {
                wx.showToast({
                  title: "请检查网络连接！",
                  icon: "none",
                  duration: 1500
                });
              }
            }
          });
        }
      });
    },
    // 提交资料第三步
    tijiaoRequest() {
      var headerCode;
      var data = {
        auth_cardid: this.datas.auth_cardid,
        auth_card_img_a: this.datas.auth_card_img_a,
        auth_card_img_b: this.datas.auth_card_img_b,
        auth_license: this.datas.auth_license,
        auth_platform: this.datas.auth_platform,
        auth_name: this.datas.auth_name
      };
      var arr = {
        auth_cardid: "身份证号",
        auth_card_img_a: "身份证正面",
        auth_card_img_b: "身份证反面",
        auth_license: "营业执照",
        auth_platform: "平台认证资料"
      };

      for (var ele in data) {
        if (!data[ele]) {
          wx.showToast({
            title: arr[ele] + "不能为空",
            icon: "none",
            duration: 2000
          });
          return;
        }
      }
      wx.getStorage({
        key: "koken",
        success: res => {
          headerCode = "Bearer " + res.data;
          wx.request({
            url: "https://api.zhaoshengku.net/index/member/therAuth",
            method: "POST",
            data: data,
            header: {
              Authorization: headerCode,
              "content-type": "application/x-www-form-urlencoded"
            },
            success: res => {
              if (res.data.code == 200) {
                wx.showToast({
                  title: "提交成功，等待审核",
                  icon: "none",
                  duration: 2000
                });
                setTimeout(() => {
                  wx.reLaunch({
                    url: "/pages/my/main"
                  });
                }, 1500);
              } else {
                wx.showToast({
                  title: res.data.msg,
                  icon: "none",
                  duration: 1000,
                  mask: true
                });
              }
            },
            fail: res => {
              if (res.errMsg) {
                wx.showToast({
                  title: "请检查网络连接！",
                  icon: "none",
                  duration: 1500
                });
              }
            }
          });
        }
      });
    },
    // 七牛方法
    initQiniu() {
      var options = {
        region: "NCN", // 华北区
        uptokenURL: "https://api.zhaoshengku.net/index/uploader/qtoken", //请求后端uptoken的url地址
        domain: "https://www.zhaoshengku.net" //yourBucketId:这个去你域名配置那里要
        //save_key: true
      };
      qiniuUploader.init(options);
    },
    // 上传图片
    tabHeaderSrc(e) {
      if (this.chongfushangcimg) {
        wx.showToast({
          title: "请勿重复操作！",
          icon: "none",
          duration: 1500
        });
        return;
      }
      this.chongfushangcimg = true;
      this.$options.methods.initQiniu();
      wx.showToast({
        title: "",
        icon: "loading",
        duration: 5000
      });
      wx.chooseImage({
        count: 1, //一次最多可以选择的图片张数
        sizeType: ["original", "compressed"], // 可以指定是原图还是压缩图，默认二者都有
        sourceType: ["album", "camera"], // 可以指定来源是相册还是相机，默认二者都有
        success: res => {
          var filePath = res.tempFilePaths[0];
          var xiaoimgSrc = res.tempFilePaths[0].substring(7);
          // 交给七牛上传
          qiniuUploader.upload(
            filePath,
            res => {
              if (e == 0) {
                this.datas.auth_card_img_a = res.data.url;
                wx.hideToast();
                this.chongfushangcimg = false;
              } else if (e == 1) {
                this.datas.auth_card_img_b = res.data.url;
                wx.hideToast();
                this.chongfushangcimg = false;
              } else if (e == 2) {
                this.datas.auth_license = res.data.url;
                wx.hideToast();
                this.chongfushangcimg = false;
              } else if (e == 3) {
                this.datas.auth_platform = res.data.url;
                wx.hideToast();
                this.chongfushangcimg = false;
              }
            },
            error => {},
            null, // 可以使用上述参数，或者使用 null 作为参数占位符
            progress => {},
            () => {
              wx.hideLoading();
            }
          );
        },
        fail: function() {},
        complete: function() {
          wx.hideToast();
        }
      });
    },
    // 预览文件
    downloadTask() {
      var _this = this;
      var url = "https://www.zhaoshengku.net/www.zhaoshengku.net.jpg";
      var urls = [url];
      wx.previewImage({
        current: url, // 当前显示图片的http链接
        urls: urls // 需要预览的图片http链接列表
      });
    }
    // //下载文件
    // downloadTaskss() {
    //   wx.downloadFile({
    //     url: "https://www.zhaoshengku.net/zsksqqrs.pdf",

    //     success: function(res) {
    //       var filePath = res.tempFilePath;
    //       console.log(filePath);
    //       wx.openDocument({
    //         filePath: filePath,

    //         success: function(res) {
    //           console.log("打开文档成功");
    //         }
    //       });
    //     }
    //   });
    // }
  },
  mounted() {
    //  获取省份信息
    this.nextBuData = 1;
    wx.request({
      url: "https://api.zhaoshengku.net/api/data/getareas",
      method: "post",
      success: res => {
        this.arraySheng = res.data.data;
        for (var i = 0; i < this.arraySheng.length; i++) {
          this.shengarr.push(this.arraySheng[i].city_name);
        }
      },
      fail: res => {
        if (res.errMsg) {
          wx.showToast({
            title: "请检查网络连接！",
            icon: "none",
            duration: 1500
          });
        }
      }
    });
    // 设置头
    wx.setNavigationBarTitle({
      title: "平台认证"
    });
    // 获取时间
    this.nowTime = util.formatTime(new Date());
    // 获取用户已编辑资料信息
    var headerCode;
    wx.getStorage({
      key: "koken",
      success: res => {
        headerCode = "Bearer " + res.data;
        wx.request({
          url: "https://api.zhaoshengku.net/index/member/getAuth",
          method: "POST",
          header: {
            Authorization: headerCode
          },
          success: res => {
            console.log(res);
            if (res.data.code == 200 || res.data.code == 201) {
              if (!res.data.data.auth_name) {
                return;
              } else {
                this.datas = res.data.data;
                var substrings = res.data.data.auth_license_true_address;
                var strings = substrings.split(",");
                if (strings[0] != "undefined") {
                  this.datas.info_province = strings[0];
                } else {
                  this.datas.info_province = "选择省";
                }
                if (strings[1] != "undefined") {
                  this.datas.info_city = strings[1];
                } else {
                  this.datas.info_city = "选择市";
                }
                if (strings[2] != "undefined") {
                  this.datas.info_county = strings[2];
                } else {
                  this.datas.info_county = "选择区/县";
                }

                this.datas.auth_license_true_address =
                  strings[strings.length - 1];
                this.datas.info_province_id = res.data.data.province_id;
                this.datas.info_city_id = res.data.data.city_id;
                this.datas.info_county_id = res.data.data.county_id;
                this.datas.auth_time = res.data.data.auth_time.substring(0, 10);
                if (res.data.data.auth_state == 1) {
                  wx.showToast({
                    title: "您已通过认证！",
                    icon: "true",
                    duration: 1000
                  });
                  this.isshow = true;
                } else if (res.data.data.auth_state == 2) {
                  this.isshow = false;
                } else if (res.data.data.auth_state == 0) {
                  wx.showToast({
                    title: "正在审核中！请耐心等待",
                    icon: "none",
                    duration: 1000
                  });
                  this.isshow = false;
                }
              }
            }
          },
          fail: res => {
            if (res.errMsg) {
              wx.showToast({
                title: "请检查网络连接！",
                icon: "none",
                duration: 1500
              });
            }
          }
        });
      }
    });

    // 获取是否被打回
  },
  onPullDownRefresh() {
    wx.stopPullDownRefresh();
  }
};
</script>

<style scoped>
/* 个人信息模块开始 */
.EditProfile-my_die_times {
  display: flex;
}
.picker {
  width: 120rpx;
  color: #333;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: center;
}
.picker_img {
  width: 25rpx;
  height: 24rpx;
}
.picker_input {
  width: 350rpx;
  font-size: 24rpx;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);
}
.section {
  font-size: 24rpx;
  font-weight: 400;
  color: rgba(102, 102, 102, 1);
  display: flex;
}
.section > div {
  width: 120rpx;
  margin-right: 10rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.EditProfile-my > div {
  background: #fff;
  box-sizing: border-box;
  padding-bottom: 100rpx;
}
.EditProfile-my_die_one {
  padding: 0 30rpx;
  background: #fff;
}
.EditProfile-my_die_one > div:nth-child(1) {
  font-size: 28rpx;
  font-weight: bold;
  color: rgba(0, 0, 0, 1);
}
.EditProfile-my_die_one > div > span:nth-child(1) {
  display: inline-block;
  width: 250rpx;
  text-align: right;
  font-size: 26rpx;
  font-weight: 500;
  color: rgba(51, 51, 51, 1);
  margin-right: 34rpx;
}
.EditProfile-my_die_one > div > span:nth-child(4) {
  display: inline-block;
  width: 130rpx;
  text-align: right;
  font-size: 26rpx;
  font-weight: 500;
  color: rgba(51, 51, 51, 1);
  margin-right: 34rpx;
}
.EditProfile-my_die_one > div > input {
  font-size: 24rpx;
  font-weight: 400;
  color: #333;
  width: 360rpx;
  padding-right: 20rpx;
}
.EditProfile-my_die_one > div > img {
  width: 25rpx;
  height: 25rpx;
}
.EditProfile-my_die_one > div {
  display: flex;
  align-items: center;
  border-bottom: 1rpx solid #dddddd;
  height: 110rpx;
}
.EditProfile-my_die_one > .div_nth_eit > img {
  width: 12rpx;
  height: 22rpx;
}
.EditProfile-my_die_one > .div_nth_eit > div {
  font-size: 24rpx;
  font-weight: 400;
  color: rgba(102, 102, 102, 1);
}
.EditProfile-my_die_one > .div_nth_eit > input {
  padding: 0;
  width: 80rpx;
  margin-right: 10rpx;
}
/* .EditProfile-my_die_one > div:last-child {
  border-bottom: none;
} */
.EditProfile-my_die_one > .last_div_bottom {
  border-bottom: none;
}
/* 个人信息模块结束 */
/* 身份证认证开始 */
.bg {
  width: 100%;
  height: 10rpx;
  background: #eeeeee;
}
.EditProfile-my-two {
  margin-top: 10rpx;
  padding: 0 30rpx;
  background: #fff;
}
.EditProfile-my-two > div:nth-child(1) {
  font-size: 28rpx;
  font-weight: bold;
  color: rgba(51, 51, 51, 1);
  border-bottom: 1px solid #dddddd;
  height: 100rpx;
  line-height: 100rpx;
}
.EditProfile-my-two > ul > li:nth-child(1) {
  display: flex;
  height: 100rpx;
  line-height: 100rpx;
  align-items: center;
  border-bottom: 1px solid #dddddd;
}
.EditProfile-my-two > ul > li:nth-child(1) > div:nth-child(1) {
  width: 250rpx;
  font-size: 30rpx;
  font-weight: 400;
  color: rgba(0, 0, 0, 1);
  margin-right: 20rpx;
  text-align: right;
}
.EditProfile-my-two > ul > li:nth-child(1) > div:nth-child(2) input {
  font-size: 26rpx;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);
}
.EditProfile-my-two > ul > li:nth-child(2) {
  display: flex;
  height: 100rpx;
  line-height: 100rpx;
  align-items: center;
  border-bottom: 1px solid #dddddd;
}
.EditProfile-my-two > ul > li:nth-child(2) > div:nth-child(1) {
  font-size: 30rpx;
  font-weight: 400;
  color: rgba(0, 0, 0, 1);
  margin-right: 20rpx;
}
.EditProfile-my-two > ul > li:nth-child(2) > div:nth-child(2) input {
  font-size: 26rpx;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);
}
.EditProfile-my-two > ul > li > div:nth-child(1) {
  width: 250rpx;
  text-align: right;
}
.EditProfile-my-two-sfzs {
  border-bottom: none;
}
.EditProfile-my-two-sfza {
  height: 600rpx;
}
.EditProfile-my-two-sfz {
  padding-top: 29rpx;
  border-bottom: 1px solid #dddddd;
  padding-bottom: 60rpx;
  box-sizing: border-box;
}
.EditProfile-my-two-sfz > p {
  font-size: 30rpx;
  font-weight: 400;
  color: rgba(0, 0, 0, 1);
}
.EditProfile-my-two-sfz > ul {
  margin: 30rpx 0;
}
.EditProfile-my-two-sfz > ul > li {
  width: 324rpx;
  height: 279rpx;
}
.EditProfile-my-two-sfz > ul > li > div {
  padding: 40rpx;
}
.EditProfile-my-two-sfz > ul > li > div > p {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.EditProfile-my-two-sfza > ul > li > div {
  padding: 48rpx 100rpx 67rpx 100rpx;
}
.EditProfile-my-two-sfz > ul > li > div > p:nth-child(1) > img,
.EditProfile-my-two-sfz > ul > li > div > p:nth-child(4) > img {
  width: 20rpx;
  height: 5rpx;
}
.EditProfile-my-two-sfz > ul > li > div > p:nth-child(2) > img,
.EditProfile-my-two-sfz > ul > li > div > p:nth-child(3) > img {
  width: 5rpx;
  height: 20rpx;
}
.EditProfile-my-two-sfz > ul > li > div > p:nth-child(3) > img {
  margin-top: 122rpx;
}
.EditProfile-my-two-sfza > ul > li > div > p:nth-child(3) > img {
  margin-top: 286rpx;
}
.EditProfile-my-two-sfz > ul {
  display: flex;
  justify-content: space-between;
}
.EditProfile-my-two-sfz > ul > li > p {
  font-size: 28rpx;
  width: 100%;
  height: 60rpx;
  line-height: 60rpx;
  font-weight: bold;
  color: rgba(255, 255, 255, 1);
  line-height: 32px;
  text-align: center;
}
.EditProfile-my-two-sfz > ul > li {
  position: relative;
}
.EditProfile-my-two-sfz > ul > li > img {
  width: 223rpx;
  height: 152rpx;
  position: absolute;
  left: 53rpx;
  top: 47rpx;
}
.EditProfile-my-two-sfzs {
  padding-bottom: 30rpx;
  border-bottom: none;
}
.EditProfile-my-two-sfzs > ul {
  margin-bottom: 0rpx;
}
.EditProfile-my-two-sfzs > div:nth-child(3) {
  font-size: 24rpx;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);
}
/* 身份证认证结束 */
/* 平台认证开始 */
.EditProfile-my-thr {
  margin-top: 10rpx;
  padding: 0 30rpx;
  background: #fff;
}
.EditProfile-my-thr > p:nth-child(1) {
  font-size: 28rpx;
  font-weight: bold;
  color: rgba(0, 0, 0, 1);
  height: 100rpx;
  line-height: 100rpx;
  border-bottom: 1px solid #dddddd;
}
.EditProfile-my-thr > p:nth-child(3) {
  margin-top: 20rpx;
  font-size: 26rpx;
  font-weight: 400;
  color: rgba(232, 22, 22, 1);
}
.EditProfile-my-thr > ul {
  width: 100%;
}
.EditProfile-my-thr > div > ul > li {
  width: 509rpx;
  height: 297rpx;
  margin: 0 auto;
}
.EditProfile-my-thr > div > ul > li > p {
  width: 509rpx;
  height: 64rpx;
  line-height: 64rpx;
}
.EditProfile-my-thr > div > ul > li > img {
  width: 261rpx;
  height: 316rpx;
  left: 119rpx;
  top: 57rpx;
}
.EditProfile-my-thr > ul:nth-child(4) {
  box-sizing: border-box;
  margin-top: 30rpx;
  display: flex;
  align-items: center;
  padding-left: 60rpx;
  margin-right: 30rpx;
  border-bottom: 1px solid #dddddd;
  padding-bottom: 50rpx;
}
.EditProfile-my-thr > ul:nth-child(4) > li:nth-child(1) {
  margin-right: 84rpx;
}
.EditProfile-my-thr > ul:nth-child(4) > li:nth-child(1) > p > img {
  width: 186rpx;
  height: 200rpx;
  margin-bottom: 20rpx;
}
.EditProfile-my-thr > ul:nth-child(4) > li:nth-child(1) > p:nth-child(2) {
  font-size: 22rpx;
  font-weight: 400;
  color: rgba(34, 151, 212, 1);
  text-align: right;
}
.EditProfile-my-thr > ul:nth-child(4) > li:nth-child(2) {
  font-size: 30rpx;
  font-weight: bold;
  color: rgba(34, 151, 212, 1);
  width: 272rpx;
  height: 68rpx;
  text-align: center;
  line-height: 68rpx;
}
.EditProfile-my-thr > div:nth-child(5) > p:nth-child(1) {
  font-size: 30rpx;
  font-weight: 400;
  color: rgba(0, 0, 0, 1);
  height: 100rpx;
  line-height: 100rpx;
}
.EditProfile-my-thr > div:nth-child(5) > p:nth-child(2) {
  width: 100%;
  text-align: center;
}
.EditProfile-my-thr > div:nth-child(5) > p:nth-child(2) img {
  width: 561rpx;
  height: 845rpx;
}
.next_button {
  width: 685rpx;
  height: 98rpx;
  text-align: center;
  line-height: 98rpx;
  margin: 100rpx 0 100rpx 33rpx;
  background: url("http://www.zhaoshengku.net/wx-%E5%9C%86%E8%A7%92%E7%9F%A9%E5%BD%A2%20%281%29.png")
    no-repeat;
  background-size: 100% 100%;
  background-position: center center;
}
/* 平台认证结束 */
/* 三级联动开始 */
.longinPage {
  width: 100%;
  height: 100%;
  background: #f7f7f7;
}
.longinPage .head_top {
  width: 100%;
  height: 38px;
  background: #fff;
  box-shadow: 0 2px 4px 0 rgba(238, 236, 236, 0.5);
  margin-bottom: 10px;
  position: relative;
}
.Unlimited {
  width: 100%;
  height: 38px;
  font-size: 16px;
  line-height: 38px;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
}
.cancel {
  width: 100%;
  height: 38px;
  position: absolute;
  top: 0;
  left: 0;
}
.cancel > div {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ccc;
  color: #999;
  line-height: 22px;
  text-align: center;
}
.cancel > div:nth-child(1) {
  position: absolute;
  top: 9px;
  left: 25%;
}
.cancel > div:nth-child(2) {
  position: absolute;
  top: 9px;
  left: 57%;
}
.cancel > div:nth-child(3) {
  position: absolute;
  top: 9px;
  right: 5%;
}
.CityList {
  width: 500rpx;
  height: 38px;
  line-height: 38px;
  display: flex;
  justify-content: space-between;
  padding: 0 5%;
  box-sizing: border-box;
}
.CityList > div {
  text-align: center;
  font-size: 26rpx;
  font-family: PingFang SC;
  font-weight: 400;
  color: rgba(102, 102, 102, 1);
}
.ChoiceCity {
  padding: 0;
}
.main {
  width: 100%;
  overflow: hidden;
  padding: 0 3%;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.main_list {
  width: 49%;
  height: 188px;
  background: #fff;
  box-shadow: 0 2px 4px 0 rgba(229, 227, 227, 0.5);
  margin-bottom: 10px;
}
.main_list_img {
  width: 100%;
  height: 108px;
}
.content {
  width: 90%;
  margin: 0 auto;
}
.content_title {
  font-size: 12px;
  color: #333333;
  margin-top: 5px;
}
.content_Second {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content_Second > div {
  font-size: 12px;
  color: #333333;
}
.content_Second > div:nth-child(3) {
  font-size: 15px;
  color: red;
  line-height: 17px;
}
.content_time {
  font-size: 12px;
  color: #787777;
}

.shop {
  display: flex;
  justify-content: space-between;
}
.shop > div {
  width: 30%;
  height: 38px;
  line-height: 38px;
  text-align: center;
}
/* 三级联动结束 */
/* 营业执照认证开始 */
.EditProfile-my-two-sfz_shili > div:nth-child(1) {
  height: 110rpx;
  line-height: 110rpx;
  font-size: 30rpx;
  font-weight: 400;
  color: rgba(0, 0, 0, 1);
}
.EditProfile-my-two-sfz_shili > div:nth-child(2) {
  width: 512.6rpx;
  padding: 45rpx;
  box-sizing: border-box;
  margin: 0 auto;
  background: url("https://www.zhaoshengku.net/wx-jvxingfive.png") center center
    no-repeat;
  background-size: 100% 100%;
  position: relative;
}
.EditProfile-my-two-sfz_shili > div:nth-child(2) > p {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.EditProfile-my-two-sfz_shili > div:nth-child(2) > p:nth-child(3) {
  margin-top: 499rpx;
}
.EditProfile-my-two-sfz_shili > div:nth-child(2) > p:nth-child(1) > img,
.EditProfile-my-two-sfz_shili > div:nth-child(2) > p:nth-child(4) > img {
  width: 22.4rpx;
  height: 3.2rpx;
}
.EditProfile-my-two-sfz_shili > div:nth-child(2) > p:nth-child(2) > img,
.EditProfile-my-two-sfz_shili > div:nth-child(2) > p:nth-child(3) > img {
  width: 3.2rpx;
  height: 22.4rpx;
}
.EditProfile-my-two-sfz_shili > div:nth-child(2) > img {
  width: 341rpx;
  height: 460rpx;
  position: absolute;
  left: 93rpx;
  top: 81rpx;
}
.EditProfile-my-two-sfz_shili > div:nth-child(3) {
  font-size: 26rpx;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);

  text-align: center;
  margin: 51rpx 0;
}
.placeholder {
  color: #999;
}
input {
  color: #333;
}
.pickerss {
  float: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* .pickersss{} */
/* 营业执照认证结束 */
</style>
